package pojo;

import java.util.Objects;

public class MiniUserChatMessage {

    /**
     * 该条消息的发送者
     */
    private String sendOpenid;

    /**
     * 该条消息的接收者
     */
    private String receiveOpenid;


    public MiniUserChatMessage(String sendOpenid, String receiveOpenid) {
        this.sendOpenid = sendOpenid;
        this.receiveOpenid = receiveOpenid;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        MiniUserChatMessage that = (MiniUserChatMessage) o;
        return (Objects.equals(sendOpenid, that.sendOpenid) || Objects.equals(sendOpenid, that.receiveOpenid)) && (Objects.equals(receiveOpenid, that.receiveOpenid) || Objects.equals(receiveOpenid, that.sendOpenid));
    }

    @Override
    public int hashCode() {
        return Objects.hash(sendOpenid, receiveOpenid);
    }
}
